/*
 * Copyright (c) 2022  by Junzhao
 * THIS FILE IS PART OF JAVASE Song Huongkang PROJECT
 * All Rights Reserved.
 */

package 练习.test10包装类的使用;

import java.util.Scanner;
import java.util.Vector;

public class Wrapper {

    public static void main(String[] args) {
        System.out.println("请输入学生成绩，以负数结束");
        Vector<Integer> studentScore =new Vector<>();

        Scanner sc =new Scanner(System.in);
        boolean flag =true;

        while(flag)
        {
            Integer integer = sc.nextInt();
            if (integer>=0&&integer<=100){
                studentScore.add(integer);
            }else if (integer>100){
                System.out.println("成绩不大于100！");
            }else{
                flag =false;
                sc.close();
            }
        }


        int max = 0;
        for (Integer i: studentScore){
            if (i> max){
                max = i;// 自动拆箱
            }
        }
        for (Integer i: studentScore){
            System.out.println("分数" + i.toString());
            if (max - i<=10){
                System.out.println("A等");
            }else if (max - i<=20){
                System.out.println("B等");
            }else if (max - i<=30){
                System.out.println("C等");
            }else{
                System.out.println("D等");
            }
        }

    }
}
